/*
Copyright (c) 2010 Andreas Bjerkeholt
License: MIT
http://www.opensource.org/licenses/mit-license.php
*/
#include "music.h"
#include "musicfile.h"

bool musicLoaded = false;

void loadMusic()
{
	if (!musicLoaded && configMusic == CONFIG_MUSIC_ON)
	{
		mixerPause(true);
		if (!mixerSetOgg("ChipWorld.ogg"))
		{
			mixerSetOggFromBuffer(oggMusic, oggMusicSize);
		}
		mixerPause(false);

		musicLoaded = true;
	}
}

void unloadMusic()
{
	if (musicLoaded)
	{
		mixerOggClear();
		musicLoaded = false;
	}
}
